<?php

namespace App\Services\Constant;

class Formula
{
    /**
     * @param $signDay
     * @return float|int
     * 计算连续签到积分
     */
    public static function signIntegral($signDay)
    {
        $integral = ($signDay - 1) * Constants::SIGN_INTEGRAL + Constants::FIRST_SIGN;
        return $integral;
    }

    /**
     * @param $i
     * @return float|int
     * 计算总共签到天数总积分
     */
    public static function evenSign($signDay)
    {
        //末次签到奖励=首次签到奖励＋公差*（连续签到天数－1）*连签天数/2
        $continuous = (5 + Constants::SIGN_INTEGRAL * $signDay) * $signDay / 2;
        return $continuous;
    }
}